Dynomotion

Group: DynoMotion Message: 4646 From: Fouijar Date: 4/25/2012
Subject: Macro calls within mach3
Hello,

I'm finally getting everything to work. I tuned my servos, did the programs for almost everything but I still need to understand how to interact with macros in mach3.

So, if someone could help me to understand step by step?
I already read the Kflop manual, but I'm not very confident.
I would like to ask if someone has m3.m1s, m5.m1s files just to start with something very simple.

Thanks for your attention.

Jerome
Group: DynoMotion Message: 4653 From: Tom Kerekes Date: 4/25/2012
Subject: Re: Macro calls within mach3
Hi Jerome,
 
Your question is very vague.  I t would be helpful for us to know something specific that you need to do.
 
But the basic sequence is:
 
#1 In Mach3 you assign VB code to M Codes (this is regardless of whether you want to do something in KFLOP or not)
 
#2 From VB it is possible to tell the Plugin to notify KFLOP to do something by sending a message.  So you would include a:
 
    NotifyPlugins(10000);
 
#3 The Dynomotion Plugin will receive the notification, set the message number 10000 into a persist variable in KFLOP, then invoke a KFLOP Notify C Program.
 
#4 The C program will check the message number to determine what action it should perform, then perform the action.
 
 
An example of all this (which also includes writing Mach3 DRO values down to KFLOP) is the Rigid Tapping Description here:
 
 
 
Regards
TK
 
Group: DynoMotion Message: 4656 From: Fouijar Date: 4/25/2012
Subject: Re: Macro calls within mach3
Hello Tom,

I would like to start from the most simple example, like m3.m1s

My macro is the following:

sub DoSpinCW()
If IsActive(OUTPUT2) then DeactivateSignal(OUTPUT2)
else
ActivateSignal(OUTPUT3)
end sub

This is just a simple code to check the actual rotation direction unabled and activate the corresponding direction,. Output 3 is CW direction, this signal is normally relayed by the kanalog to the drive.

Then I suppose that my SpindleDACmach3.c file is acting for the speed conversion. But I don't see how the speed information is sent to kflop, by the plugin I suppose or should I catch the "S" message and send it to my c program ?.

If I have to catch the S word, I don't figure how to.

I already read the G84/M84 file description.

I think my major problem is the use of persistent variables, so a simple example based on the m3 macro could help a lot.

Thanks a lot,

Jerome


--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Jerome,
>  
> Your question is very vague.  I t would be helpful for us to know something specific that you need to do.
>  
> But the basic sequence is:
>  
> #1 In Mach3 you assign VB code to M Codes (this is regardless of whether you want to do something in KFLOP or not)
>  
> #2 From VB it is possible to tell the Plugin to notify KFLOP to do something by sending a message.  So you would include a:
>  
>     NotifyPlugins(10000);
>  
> #3 The Dynomotion Plugin will receive the notification, set the message number 10000 into a persist variable in KFLOP, then invoke a KFLOP Notify C Program.
>  
> #4 The C program will check the message number to determine what action it should perform, then perform the action.
>  
>  
> An example of all this (which also includes writing Mach3 DRO values down to KFLOP) is the Rigid Tapping Description here:
>  
> http://dynomotion.com/Help/Mach3Plugin/Mach3RigidTapping.htm
>  
>  
> Regards
> TK
>  
>
> ________________________________
> From: Fouijar <fouijar@...>
> To: DynoMotion@yahoogroups.com
> Sent: Wednesday, April 25, 2012 3:51 PM
> Subject: [DynoMotion] Macro calls within mach3
>
>
>  
> Hello,
>
> I'm finally getting everything to work. I tuned my servos, did the programs for almost everything but I still need to understand how to interact with macros in mach3.
>
> So, if someone could help me to understand step by step?
> I already read the Kflop manual, but I'm not very confident.
> I would like to ask if someone has m3.m1s, m5.m1s files just to start with something very simple.
>
> Thanks for your attention.
>
> Jerome
>
Group: DynoMotion Message: 4668 From: Fouijar Date: 4/26/2012
Subject: Re: Macro calls within mach3
Hi Tom,

I think I have to follow the procedure described here:
http://tech.groups.yahoo.com/group/DynoMotion/message/793

I'll try to do it and submit for appreciation.

Regards,

Jerome

--- In DynoMotion@yahoogroups.com, "Fouijar" <fouijar@...> wrote:
>
> Hello Tom,
>
> I would like to start from the most simple example, like m3.m1s
>
> My macro is the following:
>
> sub DoSpinCW()
> If IsActive(OUTPUT2) then DeactivateSignal(OUTPUT2)
> else
> ActivateSignal(OUTPUT3)
> end sub
>
> This is just a simple code to check the actual rotation direction unabled and activate the corresponding direction,. Output 3 is CW direction, this signal is normally relayed by the kanalog to the drive.
>
> Then I suppose that my SpindleDACmach3.c file is acting for the speed conversion. But I don't see how the speed information is sent to kflop, by the plugin I suppose or should I catch the "S" message and send it to my c program ?.
>
> If I have to catch the S word, I don't figure how to.
>
> I already read the G84/M84 file description.
>
> I think my major problem is the use of persistent variables, so a simple example based on the m3 macro could help a lot.
>
> Thanks a lot,
>
> Jerome
>
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Jerome,
> >  
> > Your question is very vague.  I t would be helpful for us to know something specific that you need to do.
> >  
> > But the basic sequence is:
> >  
> > #1 In Mach3 you assign VB code to M Codes (this is regardless of whether you want to do something in KFLOP or not)
> >  
> > #2 From VB it is possible to tell the Plugin to notify KFLOP to do something by sending a message.  So you would include a:
> >  
> >     NotifyPlugins(10000);
> >  
> > #3 The Dynomotion Plugin will receive the notification, set the message number 10000 into a persist variable in KFLOP, then invoke a KFLOP Notify C Program.
> >  
> > #4 The C program will check the message number to determine what action it should perform, then perform the action.
> >  
> >  
> > An example of all this (which also includes writing Mach3 DRO values down to KFLOP) is the Rigid Tapping Description here:
> >  
> > http://dynomotion.com/Help/Mach3Plugin/Mach3RigidTapping.htm
> >  
> >  
> > Regards
> > TK
> >  
> >
> > ________________________________
> > From: Fouijar <fouijar@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Wednesday, April 25, 2012 3:51 PM
> > Subject: [DynoMotion] Macro calls within mach3
> >
> >
> >  
> > Hello,
> >
> > I'm finally getting everything to work. I tuned my servos, did the programs for almost everything but I still need to understand how to interact with macros in mach3.
> >
> > So, if someone could help me to understand step by step?
> > I already read the Kflop manual, but I'm not very confident.
> > I would like to ask if someone has m3.m1s, m5.m1s files just to start with something very simple.
> >
> > Thanks for your attention.
> >
> > Jerome
> >
>
Group: DynoMotion Message: 4670 From: Tom Kerekes Date: 4/26/2012
Subject: Re: Macro calls within mach3
Hi Jerome,
 
Yes Spindle Commands M3, M4, M5, S are handled as special messages that are sent to the SpindleMach3.c program.
 
Regards
TK

Group: DynoMotion Message: 4706 From: Fouijar Date: 4/30/2012
Subject: Re: Macro calls within mach3
Hello Tom,

I wrote the following line in the MDI in mach3: M3 S1000

I used the NotifyPlugins(10003), used the variable +0 in the config screen and have the following message in mach3: "scripter compile error in: M3.m1s"

I tried the variable+1, +2 aswell and have nothing more than the error message. The +0 var activates the drive but nothing more.

So, would you write me a m3 macro that should work. The ntotifyplugins(xx) function uses a variable number, is this mumber related to a predefined function?

Sorry asking you such things but I don't understand clearly.

Regards,

Jerome

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Jerome,
>  
> Yes Spindle Commands M3, M4, M5, S are handled as special messages that are sent to the SpindleMach3.c program.
>  
> Regards
> TK
>
> From: Fouijar <fouijar@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, April 26, 2012 11:10 AM
> Subject: [DynoMotion] Re: Macro calls within mach3
>
>
>  
> Hi Tom,
>
> I think I have to follow the procedure described here:
> http://tech.groups.yahoo.com/group/DynoMotion/message/793
>
> I'll try to do it and submit for appreciation.
>
> Regards,
>
> Jerome
>
> --- In DynoMotion@yahoogroups.com, "Fouijar" <fouijar@> wrote:
> >
> > Hello Tom,
> >
> > I would like to start from the most simple example, like m3.m1s
> >
> > My macro is the following:
> >
> > sub DoSpinCW()
> > If IsActive(OUTPUT2) then DeactivateSignal(OUTPUT2)
> > else
> > ActivateSignal(OUTPUT3)
> > end sub
> >
> > This is just a simple code to check the actual rotation direction unabled and activate the corresponding direction,. Output 3 is CW direction, this signal is normally relayed by the kanalog to the drive.
> >
> > Then I suppose that my SpindleDACmach3.c file is acting for the speed conversion. But I don't see how the speed information is sent to kflop, by the plugin I suppose or should I catch the "S" message and send it to my c program ?.
> >
> > If I have to catch the S word, I don't figure how to.
> >
> > I already read the G84/M84 file description.
> >
> > I think my major problem is the use of persistent variables, so a simple example based on the m3 macro could help a lot.
> >
> > Thanks a lot,
> >
> > Jerome
> >
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Jerome,
> > >  
> > > Your question is very vague.  I t would be helpful for us to know something specific that you need to do.
> > >  
> > > But the basic sequence is:
> > >  
> > > #1 In Mach3 you assign VB code to M Codes (this is regardless of whether you want to do something in KFLOP or not)
> > >  
> > > #2 From VB it is possible to tell the Plugin to notify KFLOP to do something by sending a message.  So you would include a:
> > >  
> > >     NotifyPlugins(10000);
> > >  
> > > #3 The Dynomotion Plugin will receive the notification, set the message number 10000 into a persist variable in KFLOP, then invoke a KFLOP Notify C Program.
> > >  
> > > #4 The C program will check the message number to determine what action it should perform, then perform the action.
> > >  
> > >  
> > > An example of all this (which also includes writing Mach3 DRO values down to KFLOP) is the Rigid Tapping Description here:
> > >  
> > > http://dynomotion.com/Help/Mach3Plugin/Mach3RigidTapping.htm
> > >  
> > >  
> > > Regards
> > > TK
> > >  
> > >
> > > ________________________________
> > > From: Fouijar <fouijar@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Wednesday, April 25, 2012 3:51 PM
> > > Subject: [DynoMotion] Macro calls within mach3
> > >
> > >
> > >  
> > > Hello,
> > >
> > > I'm finally getting everything to work. I tuned my servos, did the programs for almost everything but I still need to understand how to interact with macros in mach3.
> > >
> > > So, if someone could help me to understand step by step?
> > > I already read the Kflop manual, but I'm not very confident.
> > > I would like to ask if someone has m3.m1s, m5.m1s files just to start with something very simple.
> > >
> > > Thanks for your attention.
> > >
> > > Jerome
> > >
> >
>
Group: DynoMotion Message: 4707 From: Tom Kerekes Date: 4/30/2012
Subject: Re: Macro calls within mach3
Hi Jerome,
 
I think that message is coming from Mach3 VB Compiler saying you have a syntax error in your VB.
 
Maybe you misspelled it or added a comma (like you did in your email).  It also may need a newline character at the end.
 
But like I said in my previous email M3, M4, M5, S should be left as the default VB code as these are handled in a special manner by Mach3.  For Spindle on and so forth Mach3 sends special messages to the Plugin.  There is no need to use NotifyPlugins in the VB code or the Notify.c program at all.  Just use the SpindleMach3.c mechanism.  The default SpindleMach3.c program will just print the messages and pulley speed it receives from Mach3.
 
If you really want to experiment with an M code to do a Notify.c function then use M code M101 instead.
 
The NotifyPlugins parameter is just a unique number that gets passed to KFLOP as a unique code to tell it what it should do.  A Mach3 system might have many different Plugins installed.  When VB executes the NotifyPlugins command that code is sent to all Plugins.  Our Dynomotion Plugin ignores all Notify Messages outside the range of 10000 to 10999.  Only messages inside that range invoke the Notify.C program in KFLOP.
 
Regards
TK

Group: DynoMotion Message: 4719 From: Fouijar Date: 5/1/2012
Subject: Re: Macro calls within mach3
Hello Tom,

I removed the macro code I wrote and let everything as it was before.
I found that my problem came from my init.c, I defined the 4th axis as my spindle and had conflicts between 4th axis and spindle control. At the beginning I thought it was necessary to declare my spindle in the init.c if I wanted to control it with Mach3.
Now everything is fine to start tuning and better control.

I was "lost" because I well understood your explanations and the help I found but I didn't noticed I did a wrong init. So nothing was good due to conflicts until I decided to rewrite an Init file without spindle parameters.

As usual, many many thanks for your time and valuable help.

Regards,

Jerome


--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Jerome,
>  
> I think that message is coming from Mach3 VB Compiler saying you have a syntax error in your VB.
>  
> Maybe you misspelled it or added a comma (like you did in your email).  It also may need a newline character at the end.
>  
> But like I said in my previous email M3, M4, M5, S should be left as the default VB code as these are handled in a special manner by Mach3.  For Spindle on and so forth Mach3 sends special messages to the Plugin.  There is no need to use NotifyPlugins in the VB code or the Notify.c program at all.  Just use the SpindleMach3.c mechanism.  The default SpindleMach3.c program will just print the messages and pulley speed it receives from Mach3.
>  
> If you really want to experiment with an M code to do a Notify.c function then use M code M101 instead.
>  
> The NotifyPlugins parameter is just a unique number that gets passed to KFLOP as a unique code to tell it what it should do.  A Mach3 system might have many different Plugins installed.  When VB executes the NotifyPlugins command that code is sent to all Plugins.  Our Dynomotion Plugin ignores all Notify Messages outside the range of 10000 to 10999.  Only messages inside that range invoke the Notify.C program in KFLOP.
>  
> Regards
> TK
>
> From: Fouijar <fouijar@...>
> To: DynoMotion@yahoogroups.com
> Sent: Monday, April 30, 2012 5:00 PM
> Subject: [DynoMotion] Re: Macro calls within mach3
>
>
>  
> Hello Tom,
>
> I wrote the following line in the MDI in mach3: M3 S1000
>
> I used the NotifyPlugins(10003), used the variable +0 in the config screen and have the following message in mach3: "scripter compile error in: M3.m1s"
>
> I tried the variable+1, +2 aswell and have nothing more than the error message. The +0 var activates the drive but nothing more.
>
> So, would you write me a m3 macro that should work. The ntotifyplugins(xx) function uses a variable number, is this mumber related to a predefined function?
>
> Sorry asking you such things but I don't understand clearly.
>
> Regards,
>
> Jerome
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Jerome,
> >  
> > Yes Spindle Commands M3, M4, M5, S are handled as special messages that are sent to the SpindleMach3.c program.
> >  
> > Regards
> > TK
> >
> > From: Fouijar <fouijar@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Thursday, April 26, 2012 11:10 AM
> > Subject: [DynoMotion] Re: Macro calls within mach3
> >
> >
> >  
> > Hi Tom,
> >
> > I think I have to follow the procedure described here:
> > http://tech.groups.yahoo.com/group/DynoMotion/message/793
> >
> > I'll try to do it and submit for appreciation.
> >
> > Regards,
> >
> > Jerome
> >
> > --- In DynoMotion@yahoogroups.com, "Fouijar" <fouijar@> wrote:
> > >
> > > Hello Tom,
> > >
> > > I would like to start from the most simple example, like m3.m1s
> > >
> > > My macro is the following:
> > >
> > > sub DoSpinCW()
> > > If IsActive(OUTPUT2) then DeactivateSignal(OUTPUT2)
> > > else
> > > ActivateSignal(OUTPUT3)
> > > end sub
> > >
> > > This is just a simple code to check the actual rotation direction unabled and activate the corresponding direction,. Output 3 is CW direction, this signal is normally relayed by the kanalog to the drive.
> > >
> > > Then I suppose that my SpindleDACmach3.c file is acting for the speed conversion. But I don't see how the speed information is sent to kflop, by the plugin I suppose or should I catch the "S" message and send it to my c program ?.
> > >
> > > If I have to catch the S word, I don't figure how to.
> > >
> > > I already read the G84/M84 file description.
> > >
> > > I think my major problem is the use of persistent variables, so a simple example based on the m3 macro could help a lot.
> > >
> > > Thanks a lot,
> > >
> > > Jerome
> > >
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Jerome,
> > > >  
> > > > Your question is very vague.  I t would be helpful for us to know something specific that you need to do.
> > > >  
> > > > But the basic sequence is:
> > > >  
> > > > #1 In Mach3 you assign VB code to M Codes (this is regardless of whether you want to do something in KFLOP or not)
> > > >  
> > > > #2 From VB it is possible to tell the Plugin to notify KFLOP to do something by sending a message.  So you would include a:
> > > >  
> > > >     NotifyPlugins(10000);
> > > >  
> > > > #3 The Dynomotion Plugin will receive the notification, set the message number 10000 into a persist variable in KFLOP, then invoke a KFLOP Notify C Program.
> > > >  
> > > > #4 The C program will check the message number to determine what action it should perform, then perform the action.
> > > >  
> > > >  
> > > > An example of all this (which also includes writing Mach3 DRO values down to KFLOP) is the Rigid Tapping Description here:
> > > >  
> > > > http://dynomotion.com/Help/Mach3Plugin/Mach3RigidTapping.htm
> > > >  
> > > >  
> > > > Regards
> > > > TK
> > > >  
> > > >
> > > > ________________________________
> > > > From: Fouijar <fouijar@>
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Wednesday, April 25, 2012 3:51 PM
> > > > Subject: [DynoMotion] Macro calls within mach3
> > > >
> > > >
> > > >  
> > > > Hello,
> > > >
> > > > I'm finally getting everything to work. I tuned my servos, did the programs for almost everything but I still need to understand how to interact with macros in mach3.
> > > >
> > > > So, if someone could help me to understand step by step?
> > > > I already read the Kflop manual, but I'm not very confident.
> > > > I would like to ask if someone has m3.m1s, m5.m1s files just to start with something very simple.
> > > >
> > > > Thanks for your attention.
> > > >
> > > > Jerome
> > > >
> > >
> >
>